﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Ivy.Common.Framework.GeneralUtility;
using Ivy.Common.Framework.EmailUtility;

using Ivy.SiteAdministration.Entity;
using Ivy.SiteAdministration.DataAccess;
using Ivy.SiteAdministration.IBusinessLogic;

namespace Ivy.SiteAdministration.BusinessLogic
{
    public class SiteAdministrationBus : ISiteAdministration
    {
        #region  Variable & constant
        // All constants and local variable should be declared here
        // TRY NOT TO CREATE PUBLIC VARIABLES INSTEAD USE PROPERTIES FOR THAT PURPOSE.
        // Variable naming convention :- 
        // The naming should be self explanatory, make it long to explain the purpose 
        // and use PascalCase to seperate words as shown in the example below.
        // DO NOT USE ANY ABBRIVIATION use full word (like "Customer" instead of "Cust"
        // Naming convention for all local variable should start with underscore "_"
        // Naming convention for all local constant should start with "_The"
        // Example :    string _CustomerCode = string.Empty;
        // Example :    const string _TheDefaultSmtpServer = "DefaultSmtpServer";
        // ==================== START YOUR CODE FROM NEXT LINE ========================


        #endregion  Variable & constant

        #region Constructor & Destructor
        // Cut and Copy the default constructor for the class inside this region.
        // Generally not required in UI layer.
        // Example:
        // public SampleClassTemplate()
        // {

        // }
        // ==================== START YOUR CODE FROM NEXT LINE ========================


        #endregion Constructor & Destructor

        #region Properties
        // Any value/variable that needs to be exposed outside the class we need to create a property.
        // Avoid creating public variables rather create public properties.
        // UI layer may have public custom properties. these are very handy for User Controls.
        // Property naming convention :- Properties will be exposed outside the class, 
        // the naming should be self explanatory, make it long to explain the purpose 
        // and use PascalCase to seperate words as shown in the example below.
        // DO NOT USE ANY ABBRIVIATION use full word (like "Customer" instead of "Cust"
        // All properties should have a corresponding local variable 
        // and the property name and local variable name should match.
        // Example :
        // public string CustomerCode
        // {
        //     get
        //     {
        //         return _CustomerCode;
        //     }
        //     set
        //     {
        //         _CustomerCode = value;
        //     }
        // }
        // ==================== START YOUR CODE FROM NEXT LINE ========================


        #endregion Properties

        #region Events
        // Generally UI layer will have public events.
        // Cut and Copy the default generated events for the class inside this region.
        // ==================== START YOUR CODE FROM NEXT LINE ========================


        #endregion Events

        #region Public Methods
        // Any method that needs to be exposed outside the class will be created inside this region.
        // Public Method naming convention :- Public Method will be exposed outside the class, 
        // The input and output parameters are also going to be exposed outside the class
        // the naming should be self explanatory, make it long to explain the purpose 
        // and use PascalCase to seperate words as shown in the example below.
        // DO NOT USE ANY ABBRIVIATION use full word (like "Customer" instead of "Cust"
        // Example :
        // public bool RegisterNewCustomer(Customer Customer)
        // {
        //     bool IsCustomerDataSaved = false;
        //     //TO DO logic to save data
        //     IsCustomerDataSaved = InsertCustomerDataUsingDao(Customer);
        //     return IsCustomerDataSaved;
        // }
        // ==================== START YOUR CODE FROM NEXT LINE ========================

       
        #region Sys_SessionLog
        public bool SaveUserSys_SessionLogDetails(Sys_SessionLog lSys_SessionLogEntity)
        {
            bool IsOperationSuccessful = false;


            Sys_SessionLogDao lSys_SessionLogDao = new Sys_SessionLogDao();
            IsOperationSuccessful = lSys_SessionLogDao.Insert(lSys_SessionLogEntity);


            return IsOperationSuccessful;
        }

        public bool UpdateUserSys_SessionLogDetails(Sys_SessionLog lSys_SessionLogEntity)
        {
            bool IsOperationSuccessful = false;


            Sys_SessionLogDao lSys_SessionLogDao = new Sys_SessionLogDao();
            IsOperationSuccessful = lSys_SessionLogDao.Update(lSys_SessionLogEntity);


            return IsOperationSuccessful;
        }

        public Sys_SessionLog GetSys_SessionLogByUserSessionID(string UserSessionID)
        {
            Sys_SessionLogDao lSys_SessionLogDao = new Sys_SessionLogDao();
            Sys_SessionLog lSys_SessionLog;
            lSys_SessionLog = lSys_SessionLogDao.GetByUserSessionID(UserSessionID);
            if (lSys_SessionLog == null)
            {
                return null;
            }
            else
            {
                return lSys_SessionLog;
            }
        }

        public List<Sys_SessionLog> GetAllSys_SessionLogDetails()
        {
            List<Sys_SessionLog> lSys_SessionLogList = new List<Sys_SessionLog>();
            Sys_SessionLogDao lSys_SessionLogDao = new Sys_SessionLogDao();
            lSys_SessionLogList = lSys_SessionLogDao.GetAll();

            return lSys_SessionLogList;
        }

        public List<Sys_SessionLogReport> GetAllSys_SessionLogReportDetails()
        {
            List<Sys_SessionLogReport> lSys_SessionLogReportList = new List<Sys_SessionLogReport>();
            Sys_SessionLogReportDao lSys_SessionLogReportDao = new Sys_SessionLogReportDao();
            lSys_SessionLogReportList = lSys_SessionLogReportDao.GetAll();

            return lSys_SessionLogReportList;
        }

        public Sys_SessionLogReport GetSys_SessionLogReportByKey(int SessionLogPrimaryID)
        {
            Sys_SessionLogReportDao lSys_SessionLogReportDao = new Sys_SessionLogReportDao();
            Sys_SessionLogReport lSys_SessionLogReport;
            lSys_SessionLogReport = lSys_SessionLogReportDao.GetByKey(SessionLogPrimaryID);
            if (lSys_SessionLogReport == null)
            {
                return null;
            }
            else
            {
                return lSys_SessionLogReport;
            }
        }

        public bool DeleteByDate(DateTime FromDate, DateTime ToDate)
        {
            bool IsOperationSuccessful = false;

            Sys_SessionLogDao lSys_SessionLogDao = new Sys_SessionLogDao();
            IsOperationSuccessful = lSys_SessionLogDao.DeleteByDate(FromDate, ToDate);

            return IsOperationSuccessful;
        }
        #endregion

        #region Sys_RoleMaster
        public bool AddNewSys_RoleMaster(Sys_RoleMaster Sys_RoleMasterEntity)
        {
            bool IsOperationSuccessful = false;

            Sys_RoleMasterDao lSys_RoleMasterDao = new Sys_RoleMasterDao();
            IsOperationSuccessful = lSys_RoleMasterDao.Insert(Sys_RoleMasterEntity);

            return IsOperationSuccessful;
        }

        public bool UpdateSys_RoleMaster(Sys_RoleMaster Sys_RoleMasterEntity)
        {
            bool IsOperationSuccessful = false;

            Sys_RoleMasterDao lSys_RoleMasterDao = new Sys_RoleMasterDao();
            IsOperationSuccessful = lSys_RoleMasterDao.Update(Sys_RoleMasterEntity);

            return IsOperationSuccessful;
        }
        public Sys_RoleMaster GetSys_RoleMasterByKey(int RoleKey)
        {
            Sys_RoleMaster _Sys_RoleMaster;
            Sys_RoleMasterDao lSys_RoleMasterDao = new Sys_RoleMasterDao();
            _Sys_RoleMaster = lSys_RoleMasterDao.GetByPrimaryKey(RoleKey);
            return _Sys_RoleMaster;
        }
        public Sys_RoleMaster GetSys_RoleMasterByRoleCode(string RoleCode)
        {
            Sys_RoleMaster _Sys_RoleMaster;
            Sys_RoleMasterDao lSys_RoleMasterDao = new Sys_RoleMasterDao();
            _Sys_RoleMaster = lSys_RoleMasterDao.GetByRoleCode(RoleCode);
            return _Sys_RoleMaster;
        }
        public List<Sys_RoleMaster> GetAllSys_RoleMasterDetails()
        {
            List<Sys_RoleMaster> lSys_RoleMasterList = new List<Sys_RoleMaster>();
            Sys_RoleMasterDao lSys_RoleMasterDao = new Sys_RoleMasterDao();
            lSys_RoleMasterList = lSys_RoleMasterDao.GetAll();

            return lSys_RoleMasterList;
        }
        public Sys_RoleMaster DeleteRoleMasterByPrimaryKey(int RoleKey)
        {
            Sys_RoleMaster _Sys_RoleMaster;
            Sys_RoleMasterDao lSys_RoleMasterDao = new Sys_RoleMasterDao();
            _Sys_RoleMaster = lSys_RoleMasterDao.DeleteByPrimaryKey(RoleKey);
            if (_Sys_RoleMaster == null)
            {
                return null;
            }
            else
            {
                return _Sys_RoleMaster;
            }

        }
        public List<Sys_RoleMaster> GetAllRoleMasterByPrimaryKey(int RoleKey)
        {
            List<Sys_RoleMaster> lSys_RoleMasterList = new List<Sys_RoleMaster>();
            Sys_RoleMasterDao lSys_RoleMasterDao = new Sys_RoleMasterDao();
            lSys_RoleMasterList = lSys_RoleMasterDao.GetAllByPrimaryKey(RoleKey);

            return lSys_RoleMasterList;
        }
        #endregion

        #region Sys_ErrorLog Members
        public bool SaveSys_ErrorLogDetails(Sys_ErrorLog Sys_ErrorLogEntity)
        {
            bool IsOperationSuccessful = false;

            Sys_ErrorLogDao lSys_ErrorLogDao = new Sys_ErrorLogDao();
            IsOperationSuccessful = lSys_ErrorLogDao.Insert(Sys_ErrorLogEntity);

            return IsOperationSuccessful;
        }

        public Sys_ErrorLog GetSelectedSys_ErrorLogByErrorLogPrimaryID(int ErrorLogPrimaryID)
        {

            Sys_ErrorLogDao lSys_ErrorLogDao = new Sys_ErrorLogDao();
            Sys_ErrorLog lSys_ErrorLog;
            lSys_ErrorLog = lSys_ErrorLogDao.GetByPrimaryKey(ErrorLogPrimaryID);

            if (lSys_ErrorLog == null)
            {
                return null;
            }
            else
            {
                return lSys_ErrorLog;
            }

        }

        public List<Sys_ErrorLog> GetAllSys_ErrorLogDetails()
        {
            List<Sys_ErrorLog> lSys_ErrorLogList = new List<Sys_ErrorLog>();
            Sys_ErrorLogDao lSys_ErrorLogDao = new Sys_ErrorLogDao();
            lSys_ErrorLogList = lSys_ErrorLogDao.GetAll();

            return lSys_ErrorLogList;
        }

        //public bool Sys_ErrorLog_DeleteByDate(DateTime FromDate, DateTime ToDate)
        //{
        //    bool IsOperationSuccessful = false;

        //    Sys_ErrorLogDao lSys_ErrorLogDao = new Sys_ErrorLogDao();
        //    IsOperationSuccessful = lSys_ErrorLogDao.DeleteByDate(FromDate, ToDate);

        //    return IsOperationSuccessful;
        //}

        #endregion

        #region Sys_ActivityMaster
        public bool AddNewSys_Activity(Sys_ActivityMaster lSys_ActivityMasterEntity)
        {
            bool IsOperationSuccessful = false;

            Sys_ActivityMasterDao lSys_ActivityMasterDao = new Sys_ActivityMasterDao();
            IsOperationSuccessful = lSys_ActivityMasterDao.Insert(lSys_ActivityMasterEntity);

            return IsOperationSuccessful;
        }

        public bool UpdateSys_Activity(Sys_ActivityMaster lSys_ActivityMasterEntity)
        {
            bool IsOperationSuccessful = false;

            Sys_ActivityMasterDao lSys_ActivityMasterDao = new Sys_ActivityMasterDao();
            IsOperationSuccessful = lSys_ActivityMasterDao.Update(lSys_ActivityMasterEntity);

            return IsOperationSuccessful;
        }

        public Sys_ActivityMaster GetSys_ActivityMasterByActivityKey(int ActivityKey)
        {
            Sys_ActivityMasterDao lSys_ActivityMasterDao = new Sys_ActivityMasterDao();
            Sys_ActivityMaster lSys_ActivityMaster;
            lSys_ActivityMaster = lSys_ActivityMasterDao.GetByPrimaryKey(ActivityKey);
            if (lSys_ActivityMaster == null)
            {
                return null;
            }
            else
            {
                return lSys_ActivityMaster;
            }
        }

        public List<Sys_ActivityMaster> GetAllSys_ActivityMasterDetails()
        {
            List<Sys_ActivityMaster> lSys_ActivityMasterList = new List<Sys_ActivityMaster>();
            Sys_ActivityMasterDao lSys_ActivityMasterDao = new Sys_ActivityMasterDao();
            lSys_ActivityMasterList = lSys_ActivityMasterDao.GetAll();

            return lSys_ActivityMasterList;
        }
        public List<Sys_ActivityMaster> GetAllActivityMasterDetailsByPrimaryKey(int ActivityKey)
        {
            List<Sys_ActivityMaster> lSys_ActivityMasterList = new List<Sys_ActivityMaster>();
            Sys_ActivityMasterDao lSys_ActivityMasterDao = new Sys_ActivityMasterDao();
            lSys_ActivityMasterList = lSys_ActivityMasterDao.GetAllByPrimaryKey(ActivityKey);
            return lSys_ActivityMasterList;
        }
        public Sys_ActivityMaster DeleteActivityMasterByPrimaryKey(int ActivityKey, int ActivityTypeKey)
        {
            Sys_ActivityMaster _Sys_ActivityMaster;
            Sys_ActivityMasterDao lSys_ActivityMasterDao = new Sys_ActivityMasterDao();
            _Sys_ActivityMaster = lSys_ActivityMasterDao.DeleteByPrimaryKey(ActivityKey, ActivityTypeKey);
            if (_Sys_ActivityMaster == null)
            {
                return null;
            }
            else
            {
                return _Sys_ActivityMaster;
            }
        }
        #endregion

        #region Sys_RoleActivity

        public bool AddNewSys_RoleActivity(Sys_RoleActivity lSys_RoleActivityEntity)
        {
            bool IsOperationSuccessful = false;

            Sys_RoleActivityDao lSys_RoleActivityDao = new Sys_RoleActivityDao();
            IsOperationSuccessful = lSys_RoleActivityDao.Insert(lSys_RoleActivityEntity);

            return IsOperationSuccessful;
        }

        public bool UpdateSys_RoleActivity(Sys_RoleActivity lSys_RoleActivityEntity)
        {
            bool IsOperationSuccessful = false;

            Sys_RoleActivityDao lSys_RoleActivityDao = new Sys_RoleActivityDao();
            IsOperationSuccessful = lSys_RoleActivityDao.Update(lSys_RoleActivityEntity);

            return IsOperationSuccessful;
        }

        public List<Sys_RoleActivity> GetSys_RoleActivityByRoleKey(int RoleKey)
        {
            List<Sys_RoleActivity> lSys_RoleActivityList = new List<Sys_RoleActivity>();
            Sys_RoleActivityDao lSys_RoleActivityDao = new Sys_RoleActivityDao();
            lSys_RoleActivityList = lSys_RoleActivityDao.GetSys_RoleActivityByRoleKey(RoleKey);

            return lSys_RoleActivityList;
        }

        public List<Sys_RoleActivity> GetAllSys_RoleActivityDetails()
        {
            List<Sys_RoleActivity> lSys_RoleActivityList = new List<Sys_RoleActivity>();
            Sys_RoleActivityDao lSys_RoleActivityDao = new Sys_RoleActivityDao();
            lSys_RoleActivityList = lSys_RoleActivityDao.GetAll();

            return lSys_RoleActivityList;
        }
        public Sys_RoleActivity GetRoleActivityByPrimaryKey(int RoleKey, int RoleActivityKey)
        {
            Sys_RoleActivity _Sys_RoleActivity;
            Sys_RoleActivityDao lSys_RoleActivityDao = new Sys_RoleActivityDao();
            _Sys_RoleActivity = lSys_RoleActivityDao.GetByPrimaryKey(RoleKey, RoleActivityKey);
            return _Sys_RoleActivity;
        }
        public Sys_RoleActivity DeleteRoleActivityByPrimaryKey(int RoleKey, int RoleActivityKey)
        {
            Sys_RoleActivity _Sys_RoleActivity;
            Sys_RoleActivityDao lSys_RoleActivityDao = new Sys_RoleActivityDao();
            _Sys_RoleActivity = lSys_RoleActivityDao.DeleteByPrimaryKey(RoleKey, RoleActivityKey);
            return _Sys_RoleActivity;
        }
        public List<Sys_RoleActivity> GetAllRoleActivityByPrimaryKey(int RoleKey, int RoleActivityKey)
        {
            List<Sys_RoleActivity> lSys_RoleActivityList = new List<Sys_RoleActivity>();
            Sys_RoleActivityDao lSys_RoleActivityDao = new Sys_RoleActivityDao();
            lSys_RoleActivityList = lSys_RoleActivityDao.GetAllByPrimaryKey(RoleKey, RoleActivityKey);

            return lSys_RoleActivityList;
        }
        #endregion

        #region Sys_ActivityTypeMaster
        public Sys_ActivityTypeMaster GetSys_ActivityTypeMasterByActivityTypeKey(int ActivityTypeKey)
        {
            Sys_ActivityTypeMasterDao lSys_ActivityTypeMasterDao = new Sys_ActivityTypeMasterDao();
            Sys_ActivityTypeMaster lSys_ActivityTypeMaster;
            lSys_ActivityTypeMaster = lSys_ActivityTypeMasterDao.GetByPrimaryKey(ActivityTypeKey);
            if (lSys_ActivityTypeMaster == null)
            {
                return null;
            }
            else
            {
                return lSys_ActivityTypeMaster;
            }

        }
        public List<Sys_ActivityTypeMaster> GetAllSys_ActivityTypeMasterDetails()
        {
            List<Sys_ActivityTypeMaster> lSys_ActivityTypeMasterList = new List<Sys_ActivityTypeMaster>();
            Sys_ActivityTypeMasterDao lSys_ActivityTypeMasterDao = new Sys_ActivityTypeMasterDao();
            lSys_ActivityTypeMasterList = lSys_ActivityTypeMasterDao.GetAll();

            return lSys_ActivityTypeMasterList;
        }
        #endregion

        #region Sys_OrganizationMaster
        public bool RegisterNewOrganization(Sys_OrganizationMaster Sys_OrganizationMasterEntity)
        {
            bool IsOperationSuccessful = false;

            Sys_OrganizationMasterDao lSys_OrganizationMasterDaoDao = new Sys_OrganizationMasterDao();
            IsOperationSuccessful = lSys_OrganizationMasterDaoDao.Insert(Sys_OrganizationMasterEntity);

            return IsOperationSuccessful;
        }

        public bool UpdateRegisteredOrganization(Sys_OrganizationMaster Sys_OrganizationMasterEntity)
        {
            bool IsOperationSuccessful = false;

            Sys_OrganizationMasterDao lSys_OrganizationMasterDao = new Sys_OrganizationMasterDao();
            IsOperationSuccessful = lSys_OrganizationMasterDao.Update(Sys_OrganizationMasterEntity);

            return IsOperationSuccessful;
        }

        public Sys_OrganizationMaster GetSys_OrganizationMasterByKey(int OrganizationKey)
        {
            Sys_OrganizationMasterDao lSys_OrganizationMasterDao = new Sys_OrganizationMasterDao();
            Sys_OrganizationMaster lSys_OrganizationMaster;
            lSys_OrganizationMaster = lSys_OrganizationMasterDao.GetByPrimaryKey(OrganizationKey);
            if (lSys_OrganizationMaster == null)
            {
                return null;
            }
            else
            {
                return lSys_OrganizationMaster;
            }
        }
        #endregion

        #region Sys_RoleActivitySummaryReport
        public List<Sys_RoleActivitySummaryReport> GetSys_RoleActivitySummaryReportByRoleKey(int RoleKey)
        {
            List<Sys_RoleActivitySummaryReport> lSys_RoleActivitySummaryReportList = new List<Sys_RoleActivitySummaryReport>();
            Sys_RoleActivitySummaryReportDao lSys_RoleActivitySummaryReportDao = new Sys_RoleActivitySummaryReportDao();
            lSys_RoleActivitySummaryReportList = lSys_RoleActivitySummaryReportDao.GetSys_RoleActivitySummaryReportByRoleKey(RoleKey);

            return lSys_RoleActivitySummaryReportList;
        }

        public List<Sys_RoleActivitySummaryReport> GetAllSys_RoleActivitySummaryReportByRoleKey(int RoleKey)
        {
            List<Sys_RoleActivitySummaryReport> lSys_RoleActivitySummaryReportList = new List<Sys_RoleActivitySummaryReport>();
            Sys_RoleActivitySummaryReportDao lSys_RoleActivitySummaryReportDao = new Sys_RoleActivitySummaryReportDao();
            lSys_RoleActivitySummaryReportList = lSys_RoleActivitySummaryReportDao.GetAllSys_RoleActivitySummaryReportByRoleKey(RoleKey);

            return lSys_RoleActivitySummaryReportList;
        }

        public List<Sys_RoleActivitySummaryReport> GetAllSys_RoleActivitySummaryReportByRoleKeyActivityCode(int RoleKey, string ActivityCode)
        {
            List<Sys_RoleActivitySummaryReport> lSys_RoleActivitySummaryReportList = new List<Sys_RoleActivitySummaryReport>();
            Sys_RoleActivitySummaryReportDao lSys_RoleActivitySummaryReportDao = new Sys_RoleActivitySummaryReportDao();
            lSys_RoleActivitySummaryReportList = lSys_RoleActivitySummaryReportDao.GetAllSys_RoleActivitySummaryReportByRoleKeyActivityCode(RoleKey, ActivityCode);

            return lSys_RoleActivitySummaryReportList;
        }
        #endregion

        #region UserRoleAllocationSummaryReport
        public List<UserRoleAllocationHeaderReport> GetAllUserWiseRoleAllocation()
        {
            List<UserRoleAllocationHeaderReport> lUserRoleAllocationSummaryReportList = new List<UserRoleAllocationHeaderReport>();
            UserRoleAllocationSummaryDao lUserRoleAllocationSummaryDao = new UserRoleAllocationSummaryDao();
            lUserRoleAllocationSummaryReportList = lUserRoleAllocationSummaryDao.GetAllUserRoleAllocationSummary();

            return lUserRoleAllocationSummaryReportList;
        }
        public UserRoleAllocationHeaderReport GetAllUserRoleAllocationSummaryReportByUserKeyUserOrganizationKey(int UserKey, int UserOrganizationKey)
        {
            UserRoleAllocationHeaderReport _UserRoleAllocationSummaryReport;
            UserRoleAllocationSummaryDao lUserRoleAllocationSummaryDao = new UserRoleAllocationSummaryDao();
            _UserRoleAllocationSummaryReport = lUserRoleAllocationSummaryDao.GetAllUserRoleAllocationSummaryReportByUserKeyOrganizationKey(UserKey,UserOrganizationKey);
            return _UserRoleAllocationSummaryReport;
        }
        public List<UserRoleAllocationHeaderReport> GetAllUserRoleAllocationReport()
        {
            List<UserRoleAllocationHeaderReport> lUserRoleAllocationReportList = new List<UserRoleAllocationHeaderReport>();
            UserRoleAllocationSummaryDao lUserRoleAllocationSummaryDao = new UserRoleAllocationSummaryDao();
            lUserRoleAllocationReportList = lUserRoleAllocationSummaryDao.GetAllUserRoleAllocationReport();

            return lUserRoleAllocationReportList;
        }
        #endregion

        #region ContentTypeMaster
        public bool AddNewContentTypeMaster(ContentTypeMaster ContentTypeMasterEntity)
        {
            bool IsOperationSuccessful = false;

            ContentTypeMasterDao lContentTypeMasterDao = new ContentTypeMasterDao();
            IsOperationSuccessful = lContentTypeMasterDao.Insert(ContentTypeMasterEntity);

            return IsOperationSuccessful;
        }
        public bool UpdateContentTypeMaster(ContentTypeMaster ContentTypeMasterEntity)
        {
            bool IsOperationSuccessful = false;

            ContentTypeMasterDao lContentTypeMasterDao = new ContentTypeMasterDao();
            IsOperationSuccessful = lContentTypeMasterDao.Update(ContentTypeMasterEntity);

            return IsOperationSuccessful;
        }
        public List<ContentTypeMaster> GetAllContentTypeMasterDetails()
        {
            List<ContentTypeMaster> _ContentTypeMasterList = new List<ContentTypeMaster>();
            ContentTypeMasterDao lContentTypeMasterDao = new ContentTypeMasterDao();
            _ContentTypeMasterList = lContentTypeMasterDao.GetAll();

            return _ContentTypeMasterList;
        }
        public ContentTypeMaster GetContentTypeMasterByPrimaryKey(int ContentTypeKey)
        {
            ContentTypeMaster lContentTypeMaster;
            ContentTypeMasterDao lContentTypeMasterDao = new ContentTypeMasterDao();
            lContentTypeMaster = lContentTypeMasterDao.GetByPrimaryKey(ContentTypeKey);
            return lContentTypeMaster;
        }
        #endregion ContentTypeMaster
        #endregion Public Methods

        #region Private Methods
        // All local class level methods will be inside this region. Mostly these are helper methods.
        // Private Method naming convention :- The naming should be self explanatory, 
        // make it long to explain the purpose and use PascalCase to seperate words as shown in the example below.
        // DO NOT USE ANY ABBRIVIATION use full word (like "Customer" instead of "Cust"
        // Input parameter will have a "p" as prefix. 
        // This will help the parameter variable that the value is originated outside this private method.
        // Example :
        // public bool InsertCustomerDataUsingDao(Customer pCustomer)
        // {
        //     bool IsCustomerDataInsertedSuccessfully = false;
        //     //TO DO logic to save data
        //     //....
        //     //....
        //     return IsCustomerDataInsertedSuccessfully;
        // }
        // ==================== START YOUR CODE FROM NEXT LINE ========================


        #endregion Private Methods
    }
}
